<%@page language="java" pageEncoding="utf-8"%>
	<%
	int pagesize = Integer.parseInt(request.getAttribute("pagesize").toString());//每页显示记录数   
	int liststep = 10;//(Integer) request.getAttribute("liststep");//最多显示分页页数   
	int pages = Integer.parseInt(request.getAttribute("page").toString());
	int count = Integer.parseInt(request.getAttribute("total").toString());//假设取出记录总数  
	int pagescount = (int) Math.ceil((double) count / pagesize);//求总页数，ceil（num）取整不小于num 
	if(pages < 1){
		pages = 1;
	}
	if (pagescount < pages) {
		pages = pagescount;//如果分页变量大总页数，则将分页变量设计为总页数   
	}
	int listbegin = (pages - (int) Math.ceil((double) liststep / 2));//从第几页开始显示分页信息   
	if (listbegin < 1) { //当前页-(总显示的页列表数/2)   
		listbegin = 1;
	}
	int listend = pages + liststep / 2;//分页信息显示到第几页//当前页+(总显示的页列表数/2)   
	if (listend > pagescount) {
		listend = pagescount + 1;
	}
	String keywords = request.getAttribute("keyword")==null?"":(String)request.getAttribute("keyword");
	keywords = java.net.URLEncoder.encode(keywords, "utf-8");		 
	if(count > 0){
		%>
		&nbsp;总计<%=count %>条/<%=pagescount %>页
		<%
			if(pages > 1){
		%>			
				&nbsp;<a href="javascript:go(<%=pages-1 %>);">上一页</a>
		<%	}
			for (int i = listbegin; i < listend; i++) {
				if (i != pages) {
		%>			
		        	&nbsp;<a href="javascript:go(<%=i %>);"><%=i %></a>
		<% 	
				} else {
	    %>
					&nbsp;<a style="font-weight: bold;font-size: 16px"><%=i%></a>
		<%			
				}
			}
			if(pages != pagescount){
		%>
				&nbsp;<a href="javascript:go(<%=pages+1 %>);">下一页</a>	
		<%	}
		%>
		&nbsp;&nbsp;&nbsp;第<input type="text" style="width: 40px" id="go_page" onkeypress="sub(event.keyCode);">页&nbsp;<a href="javascript:go_page();">GO</a>
	<%	}
	%>
	<script language="javascript">
	//控制进入指定的页数
	var listForm = document.forms['listForm'];
	
	function go(page){
		listForm.page.value = page;
		listForm.submit();
	}
	function go_page(){
		var page = document.getElementById("go_page");
		if(!checkNumber(page)){			
			return ;
		}
		if(page.value > <%=pagescount%>){
			alert("超出了总页数！");
			page.focus();page.select();
			return ;
		}
		listForm.page.value = page.value;
		listForm.submit();
	}
	function sub(code){
		if(code == 13){
			go_page();
		}
	}
	</script>
           
